package com.nbcio.im.core;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * IM好友实体
 *
 * @author nbacheng
 */
@Data
@TableName("im_friend")
public class ImFriend implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    
    /**
     * 租户ID
     */
    @TableField("tenant_id")
    private String tenantId;
    
    /**
     * 用户ID
     */
    @TableField("user_id")
    private Long userId;
    
    /**
     * 好友用户ID
     */
    @TableField("friend_user_id")
    private Long friendUserId;
    
    /**
     * 好友备注
     */
    @TableField("remark")
    private String remark;
    
    /**
     * 好友分组
     */
    @TableField("group_name")
    private String groupName;
    
    /**
     * 添加时间
     */
    @TableField("add_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime addTime;
    
    /**
     * 好友状态：pending, accepted, blocked, deleted
     */
    @TableField("status")
    private String status;
    
    /**
     * 是否置顶
     */
    @TableField("is_top")
    private Integer isTop;
    
    /**
     * 是否免打扰
     */
    @TableField("is_muted")
    private Integer isMuted;
    
    /**
     * 最后聊天时间
     */
    @TableField("last_chat_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastChatTime;
}
